package com.bbx.taxi.client.Adapter.Page;

import java.util.ArrayList;
import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class MyPagerFragmentAdapter extends FragmentPagerAdapter {
	private List<Fragment> fragments = new ArrayList<Fragment>();
	private List<String> title = new ArrayList<String>();

	public MyPagerFragmentAdapter(FragmentManager fm) {
		super(fm);
	}

	public MyPagerFragmentAdapter(FragmentManager fragmentManager,
			ArrayList<Fragment> fragments,ArrayList<String> title) {
		super(fragmentManager);
		this.fragments = fragments;
		if(title!=null)this.title=title;
	}

	@Override
	public Fragment getItem(int index) {
		return fragments.get(index);
	}

	@Override
	public int getCount() {
		return fragments.size();
	}
	@Override
   public CharSequence getPageTitle(int position) {
      return title.get(position);
   }
}